use "bilateral.dta", clear

gen A=OwnAction==1
gen B=OwnAction==2
gen C=OwnAction==3

sort Period
by Period: egen fA=mean(A)
by Period: egen fB=mean(B)
by Period: egen fC=mean(C)
by Period: gen index1=_n==1



*** Figure 6

scatter fA fB fC Period if index1==1, connect(l l l) msize( 1 1 1)



append using "actions T1 - T6"


tab treatment OwnAction, row



replace C=OwnAction==3

sort session MatchingGroup

by session MatchingGroup: egen test=mean(C)
by session MatchingGroup: gen index2=_n==1


ranksum test if index2==1&(treatment==7|treatment==3) , by(treatment)
ranksum test if index2==1&(treatment==7|treatment==4) , by(treatment)
ranksum test if index2==1&(treatment==7|treatment==5) , by(treatment)
ranksum test if index2==1&(treatment==7|treatment==6) , by(treatment)

